package demo.mapper;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;

public class BaseChainMap3 extends MapReduceBase implements Mapper<LongWritable, Text, IntWritable, Text> {

	@Override
	public void map(LongWritable arg0, Text arg1, OutputCollector<IntWritable, Text> arg2, Reporter arg3)
			throws IOException {
		// TODO Auto-generated method stub
		String string = arg1.toString();
		String[] split = string.split(":");
		if(split.length<2)
			throw new RuntimeException("error");
		arg2.collect(new IntWritable(Integer.valueOf(split[0])), new Text(split[1]));
	}

}
